package com.wiscamp.ninechapters.problems.infrastructure.mappers.sheets;

import com.wiscamp.ninechapters.problems.infrastructure.po.sheets.SheetAnswerPO;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.Collection;

public interface SheetAnswerMapper extends JpaRepository<SheetAnswerPO, Long>, JpaSpecificationExecutor<SheetAnswerPO> {
    @Query(value = "select e from SheetAnswerPO e where e.sheetDetailId = :detailId")
    Collection<SheetAnswerPO> findListByDetail(long detailId);

    @Query(value = "select e from SheetAnswerPO e where e.sheetDetailId in (:detailIds)")
    Collection<SheetAnswerPO> findListByDetails(Collection<Long> detailIds);
}